import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { HrMonthlyPlanAdjustmentVO, HrMonthlyPlanAdjustmentForm, HrMonthlyPlanAdjustmentQuery } from '@/api/general/humanresources/performance/monthly/types';

/**
 * 查询员工月度计划调整审批列表
 * @param query
 * @returns {*}
 */

export const listHrMonthlyPlanAdjustment = (query?: HrMonthlyPlanAdjustmentQuery): AxiosPromise<HrMonthlyPlanAdjustmentVO[]> => {
  return request({
    url: '/humanresource/hrMonthlyPlanAdjustment/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询员工月度计划调整审批详细
 * @param id
 */
export const getHrMonthlyPlanAdjustment = (id: string | number): AxiosPromise<HrMonthlyPlanAdjustmentVO> => {
  return request({
    url: '/humanresource/hrMonthlyPlanAdjustment/' + id,
    method: 'get'
  });
};

/**
 * 新增员工月度计划调整审批
 * @param data
 */
export const addHrMonthlyPlanAdjustment = (data: HrMonthlyPlanAdjustmentForm) => {
  return request({
    url: '/humanresource/hrMonthlyPlanAdjustment',
    method: 'post',
    data: data
  });
};

/**
 * 修改员工月度计划调整审批
 * @param data
 */
export const updateHrMonthlyPlanAdjustment = (data: HrMonthlyPlanAdjustmentForm) => {
  return request({
    url: '/humanresource/hrMonthlyPlanAdjustment',
    method: 'put',
    data: data
  });
};

/**
 * 删除员工月度计划调整审批
 * @param id
 */
export const delHrMonthlyPlanAdjustment = (id: string | number | Array<string | number>) => {
  return request({
    url: '/humanresource/hrMonthlyPlanAdjustment/' + id,
    method: 'delete'
  });
};
